' BASIC Anywhere Machine mod by Charlie Veniot
' based on program found at http://basic4all.epizy.com/index.php?topic=396.0
SCREEN _NEWIMAGE(440,230,12)
CONST x_adjust = -50 : y_adjust = -100
start:
  blue_base = INT(RND*256) : green_base = INT(RND*256) : red_base = INT(RND*256)
  
  FOR n = 0 TO 15
      PALETTE n, _BGR( [blue_base\16*(n+1)], [green_base\16*(n+1)], [red_base\16*(n+1)] )
  NEXT n
  FOR z = 0 TO 100 STEP .25
      FOR a = 0 TO 6.2831853 STEP .005
          
              r = [100] + [COS( [20*a]+[z/20] )*15]
              x1 = [COS(a)*r] + [220]
              y1 = [SIN(a)*r/3] + [240] - [z/2]
              r = [50] + [SIN( [-10*a]+[z/20] )*15]
              x2 = [COS(a)*r] + [370]
              y2 = [SIN(a)*r/3] + [240] - [z/2]
          PSET ( [x1+x_adjust] , [y1 + y_adjust] ), INT( [z*.125+2.5] )
          PSET ( [x2+x_adjust] , [y2 + y_adjust] ), INT( [z*.125+2.5] )
          NEXT a
      _DELAY 0.00001
      NEXT z
  _DELAY 2
  
GOTO start